import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import HomePage from '@/views/HomePage.vue'
import ProductList from '@/views/ProductList.vue'
import ProductDetail from '@/views/ProductDetail.vue'
import BackTest from '@/views/BackTest.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/homepage',
    name: 'HomePage',
    component: HomePage,
  },
  {
    path: '/funds',
    name: 'Fund',
    component: ProductList,
  },
  {
    path: '/funds/detail',
    name: 'FundDetail',
    component: ProductDetail,
  },
  {
    path: '/backtest',
    name: 'Backtest',
    component: BackTest,
  },
  {
    path: '/',
    redirect: '/homepage',
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
